<template>
  <div class="admin-container">
    <el-container class="container">
      <el-header class="header">
        <NavBar @handleCollapse="handleCollapse" />
        <TabBar v-if="tag" />
      </el-header>
      <el-main class="main">
        <AppMain />
      </el-main>
      <footer class="footer">
        <span>{{ copyright }}</span>
      </footer>
    </el-container>
    <el-drawer v-model="isDrawer" direction="ltr" :with-header="false" @close="closeDrawer">
      <Menu />
    </el-drawer>
  </div>
</template>

<script>
export default {
  name: 'Mobile',
};
</script>

<script setup>
import { computed, ref } from 'vue';
import { useStore } from 'vuex';
import { setting } from '@/config/setting';
const { copyright } = setting;
const copyrightStr = ref(copyright);

const store = useStore();

const isDrawer = computed(() => {
  return store.getters['setting/isDrawer'];
});

const tag = computed(() => {
  return store.getters['setting/tag'];
});



const handleCollapse = () => {
  store.dispatch('setting/changeDrawer', true);
};

const closeDrawer = () => {
  store.dispatch('setting/changeDrawer', false);
};
</script>

<style lang="scss" scoped>
.admin-container {
  height: 100%;
  background-color: $base-content-bg-color;
  .container {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all $base-transition-time-4;
  }
  .header {
    height: auto;
    padding: 0;
    transition: all $base-transition-time-4;
  }
  .main {
    flex: 1;
    background-color: $base-content-bg-color;
  }
  :deep(.el-menu) {
    border-right: $base-border-none !important;
  }

  .footer {
    min-height: $footer-copyright-height;
    color: #afb9d2;
    text-align: center;
    background-color: #f0f3fb;
    font-size: $base-font-size-small;
    line-height: $footer-copyright-height;
  }
}
</style>
